<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script type="text/javascript">
        //1.让爷爷拉二胡，爸爸弹琴
        function Grand(name) {
            this.name = '爷爷'
        }
        function Parent() {
            this.name = '爸爸'
        }
        Grand.prototype.tskill = '拉二胡';
        var grand = new Grand();
        function f() { }
        f.prototype = grand
        Parent.prototype = new f();
        var parent = new Parent();
        Parent.prototype.tskill = '弹琴';
        console.log(grand.name+grand.tskill);
        console.log(parent.name+parent.tskill);
    </script>
</body>
</html>